﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;
using BLL;

namespace web.admin.InnerCon
{
    public partial class InnerAwards : System.Web.UI.Page
    {
        private AwardService awardService = new AwardService();
        private StudentService studentService = new StudentService();
        private GroupsService groupsService = new GroupsService();
        private ParticipantService participantService = new ParticipantService();
        private AcademyService academyService = new AcademyService();
        private ContestService contestService = new ContestService();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request["id"];
                if (String.IsNullOrEmpty(id))
                    return;

                ContestId.Value = id;

                RpList.DataSource = participantService.getAwardsPar(id);//查看获奖学生和小组 不显示只报名为获奖的人
                RpList.DataBind();
            }
        }

        protected void btnAddStudent_Click(object sender, EventArgs e)
        {
            if (ContestId.Value == "")
                return;

            Response.Redirect("AwardManage/AddScore.aspx?Operate=add&CON_ID=" + ContestId.Value);
        }

        protected void btnAddGroup_Click(object sender, EventArgs e)
        {
            if (ContestId.Value == "")
                return;

            Response.Redirect("AwardManage/SetPercent.aspx?CON_ID=" + ContestId.Value);
        }

        /// <summary>
        /// 修改等级比例
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void editPercent(object sender, EventArgs e)
        {
            if (ContestId.Value == "")
                return;
            Response.Redirect("AwardManage/EditPercent.aspx?CON_ID=" + ContestId.Value);
        }

        /// <summary>
        /// 修改等级比例
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpdateStudent_Click(object sender, EventArgs e)
        {
            if (ContestId.Value == "")
                return;
            Response.Redirect("AwardManage/AddScore.aspx?Operate=edit&CON_ID=" + ContestId.Value);
        }
    }
}